Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Occurence enumeration should preserve type of datetimes

#6

This came out of a question from Bruno in response to Ticket #3 Component without recurrence properties should enumerate just itself.

In attempting to understand his problem I wrote this test program

require 'rubygems'
require 'ri_cal'

cal = RiCal.parse_string <<ENDCAL
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20090520T091929Z
LAST-MODIFIED:20090520T092025Z
DTSTAMP:20090520T091929Z
UID:36197790-cf15-4aba-9213-f61d434c4cd8
SUMMARY:event1
DTSTART;VALUE=DATE:20090601
DTEND;VALUE=DATE:20090602
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
CREATED:20090520T092032Z
LAST-MODIFIED:20090520T092052Z
DTSTAMP:20090520T092032Z
UID:d41c124a-65c3-400e-bd04-1d2ee7b98352
SUMMARY:event2
RRULE:FREQ=MONTHLY;INTERVAL=1
DTSTART;VALUE=DATE:20090603
DTEND;VALUE=DATE:20090604
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR
ENDCAL
puts "occurrences of first event:"
cal.first.events.first.occurrences(:after => Date.parse('01/01/1990'), :before => Date.parse("01/01/2010")).each  do|occur|
  puts "#{occur.dtstart} which is a #{occur.dtstart.class}"
end
puts "\noccurrences of second event"
cal.first.events[1].occurrences(:after => Date.parse('01/01/1990'), :before => Date.parse("01/01/2010")).each do |occur| 
  puts "#{occur.dtstart} which is a #{occur.dtstart.class}"
end

which produces the following output:

occurrences of first event: 2009-06-01 which is a Date

occurrences of second event 2009-06-03T00:00:00+00:00 which is a DateTime 2009-07-03T00:00:00+00:00 which is a DateTime 2009-08-03T00:00:00+00:00 which is a DateTime 2009-09-03T00:00:00+00:00 which is a DateTime 2009-10-03T00:00:00+00:00 which is a DateTime 2009-11-03T00:00:00+00:00 which is a DateTime 2009-12-03T00:00:00+00:00 which is a DateTime

The first event gives a date dtstart because it has no recurrence rules, the second event, which does have a recurrence rule, is changing the type of the dtstart to DateTime. This should be fixed.

Reported by Rick DeNatale · May 21st, 2009 @ 05:16 PM

State: resolved
Milestone: 0.0.9
Assigned to: Rick DeNatale Rick DeNatale

Activity

  1. Rick DeNatale
    Rick DeNatale
    • Assigned user set to Rick DeNatale
    • Milestone set to 0.0.9

    May 21st, 2009 @ 06:19 PM

  2. Rick DeNatale
    Rick DeNatale
    • State changed from new to resolved

    May 21st, 2009 @ 07:06 PM

  3. Rick DeNatale
    Rick DeNatale
    • State changed from resolved to open

    May 21st, 2009 @ 07:20 PM

  4. Rick DeNatale
    Rick DeNatale
    • State changed from open to resolved

    May 21st, 2009 @ 07:31 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.